JBoss Community Archive (Read Only)

Scribble

Parsing a Protocol description

The parse command takes a single parameter, which is the
path to the file containing the protocol description to be parsed.

For example, if the user is in the top level folder of the Scribble tools distribution,
without the bin folder being added to the system path, then the
following command can be executed to parse one of the sample protocol descriptions:

bin/parse.sh samples/purchasing/Purchasing.spr

If the supplied file path is not valid, then the command will report an error.

This command will read the protocol description, as shown below, and convert it
into an internal object model representation.

import Order;
import CreditCheck;
import CreditOk;
import Confirmation;
import InsufficientCredit;
import OrderRejected;
import OutOfStock;

protocol Purchasing (role Buyer) {
    Buyer introduces Seller;

    Order from Buyer to Seller;

    choice at Seller {
        OutOfStock from Seller to Buyer;
    } or {
        Seller introduces CreditAgency;

        CreditCheck from Seller to CreditAgency;

        choice at CreditAgency {
            CreditOk from CreditAgency to Seller;
            Confirmation from Seller to Buyer;
        } or {
            InsuficientCredit from CreditAgency to Seller;
            OrderRejected from Seller to Buyer;
        }
    }
}

If any errors are detected in the syntax of the parsed protocol description, then
these will be reported to the command window.

JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-13 09:37:59 UTC, last content change 2011-09-14 21:51:22 UTC.